﻿// -------------------------------------------------------------------------
//    @FileName         :    NFCItyPacketSendUtil.h
//    @Author           :    Gao.Yi
//    @Date             :    2025-09-16
//    @Email			:    445267987@qq.com
//    @Module           :    NFCItyPacketSendUtil
//    @Desc             :
//
// -------------------------------------------------------------------------

#pragma once

#include "proto_cs_cmd.pb.h"
#include "NFComm/NFObjCommon/NFObject.h"

class NFCitySession;
class NFCityPlayer;
class NFCityPacketSendUtil
{
public:
    static int SendToClient(NFCitySession* pSession, uint32_t cmd, const google::protobuf::Message* pstMsgRes);
    static int SendToClient(NFCityPlayer* pPlayer, uint32_t cmd, const google::protobuf::Message* pstMsgRes);
    static int SendToClientDirectly(NFCitySession* pSession, uint32_t cmd, const google::protobuf::Message* pstMsgRes);

    static int SendToClientFinally(NFCitySession* pSession, void* pBuff, uint32_t ulSize);

    static int SendErrToClient(NFCitySession* pSession, uint32_t req_cmd, proto_ff::Proto_CS_ErrorCode result);
    static int SendErrToClient(NFCityPlayer* pPlayer, uint32_t req_cmd, proto_ff::Proto_CS_ErrorCode result);
public:
    static int SendMsgToLogicServer(NFCityPlayer* pPlayer, uint32_t cmd, const google::protobuf::Message* pstMsg);
    static int SendTransToLogicServer(NFCityPlayer* pPlayer, uint32_t cmd, const google::protobuf::Message* pstMsg, uint32_t req_trans_id = 0, uint32_t rsp_trans_id = 0);
};